// @todo:增加buffer指令用于显示发送缓存区的状态
// 格式: 
// 类型     发送总数      剩余数量
// [TYPE]   [TOTAL]      [REMAIN] 
// GPS
// LBS
// WIFI
// CAN1
// CAN2
#include "service/include/swei_cache.h"
#include "service/include/swei_uplink.h"
#include "service/include/swei_blinddata.h"
#include "lettershell/shell.h"
#include "global.h"
#include <stdio.h>

const char *send_status[] = {
    "IDLE",
    "SENDING",
    "RESENDING"
};
    
int32_t shell_buffer_print(int32_t argc, char *argv[])
{
    if (1 == argc) {
        cache_record_t *cache_rec = swei_cache_get_rec();
        printf("********************\r\n");
        printf("CACHE ITEM: %d\r\n", swei_cache_item_get());
        printf("FLASH ITEM: %d\r\n", swei_blinddata_item_get());
        printf("********************\r\n");
    }
    else if (2 == argc) {
        if (2 == strlen(argv[1]) && '-' == argv[1][0] && 'c' == argv[1][1])
            swei_uplink_data_clear();
    }
    return 0;
}
 
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN) | SHELL_CMD_DISABLE_RETURN,
                 buffer, 
                 shell_buffer_print, 
                 show the server connect status);